<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js">
</script>
<script>
    var jssdkconfig = {php echo json_encode($_W['account']['jssdkconfig']);} || {};
    // 是否启用调试
    jssdkconfig.debug = false;
    jssdkconfig.jsApiList = ['checkJsApi', 'onMenuShareTimeline', 'onMenuShareAppMessage', 'onMenuShareQQ', 'onMenuShareWeibo', 'hideMenuItems', 'showMenuItems', 'hideAllNonBaseMenuItem', 'showAllNonBaseMenuItem', 'translateVoice', 'startRecord', 'stopRecord', 'onRecordEnd', 'playVoice', 'pauseVoice', 'stopVoice', 'uploadVoice', 'downloadVoice', 'chooseImage', 'previewImage', 'uploadImage', 'downloadImage', 'getNetworkType', 'openLocation', 'getLocation', 'hideOptionMenu', 'showOptionMenu', 'closeWindow', 'scanQRCode', 'chooseWXPay', 'openProductSpecificView', 'addCard', 'chooseCard', 'openCard'];

    wx.config(jssdkconfig);
    var onBridgeReady_new = function() {};
    var openLocation = function() {};
    wx.ready(function() {
        onBridgeReady_new = function() {
            var $body = $('body');
            document.title = '互动吧';
            var $iframe = $('<iframe src="/favicon.ico"></iframe>');
            $iframe.on('load',
            function() {
                setTimeout(function() {
                    $iframe.off('load').remove();
                },
                0);
            }).appendTo($body);
            wx.onMenuShareAppMessage({
                title: dataForShare.title,
                desc: dataForShare.description,
                link: dataForShare.weixin_url,
                imgUrl: dataForShare.weixin_icon,
                trigger: function(res) {
                    _shareInWeixin._hideFromJsBridge();
                },
                success: function(res) { (dataForShare.callback)();
                },
                cancel: function(res) {},
                fail: function(res) {}
            });
            wx.onMenuShareTimeline({
                title: dataForShare.title,
                link: dataForShare.weixin_url,
                imgUrl: dataForShare.weixin_tl_icon,
                trigger: function(res) {
                    _shareInWeixin._hideFromJsBridge();
                },
                success: function(res) { (dataForShare.callback)();
                },
                cancel: function(res) {},
                fail: function(res) {}
            });
            wx.onMenuShareQQ({
                title: dataForShare.title,
                desc: dataForShare.description,
                link: dataForShare.weixin_url,
                imgUrl: dataForShare.weixin_tl_icon,
                trigger: function(res) {
                    _shareInWeixin._hideFromJsBridge();
                },
                complete: function(res) {},
                success: function(res) { (dataForShare.callback)();
                },
                cancel: function(res) {},
                fail: function(res) {}
            });
            wx.onMenuShareWeibo({
                title: dataForShare.title,
                desc: dataForShare.description,
                link: dataForShare.weixin_url,
                imgUrl: dataForShare.weixin_icon,
                trigger: function(res) {
                    _shareInWeixin._hideFromJsBridge();
                },
                complete: function(res) {},
                success: function(res) { (dataForShare.callback)();
                },
                cancel: function(res) {},
                fail: function(res) {}
            });
        }
        openLocation = function(mapJing, mapWei, mapName) {
            wx.openLocation({
                latitude: mapWei,
                longitude: mapJing,
                name: '活动地点:',
                address: mapName,
                scale: 15,
                infoUrl: 'http://www.hdb.com/'
            });
        }
        onBridgeReady_new();
    });
</script>